<?php if (!defined('THINK_PATH')) exit();?>							<style type="text/css">
                                    table button{
                                                    margin-bottom:2px !important;
                                                }</style>
                            	<table id="sample-table-2" class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
                         <!--                    <th class="center">
                                                <label>
                                                    <input type="checkbox" class="ace" id="alldel" value=""/>
                                                    <span class="lbl"></span>
                                                </label>
                                            </th> -->
											<th width="5%">序号</th>
											<th width="10%">订单号</th>
											<th width="15%">销售系统订单号</th>
											<th width="5%">金额</th>
											<th width="8%">收货人</th>
											<th width="10%">联系电话</th>
											<th width="15%" class="hidden-480">收货人地址</th>
											<th width="10%">下单时间</th>
						                    <th width="12%">身份证是否收集</th>
											<th width="5%">状态</th>
											<th width="10%">操作</th>
										</tr>
									</thead>
									<tbody>
										<?php if(is_array($lists['lists'])): $i = 0; $__LIST__ = $lists['lists'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
                                    <!--             <td class="center">
                                                        <input type="checkbox" class="ace" value="<?php echo ($vo["order_id"]); ?>" />
                                                        <span class="lbl"></span>
                                                
                                                </td> -->

												<td>
													<a href="#"><?php echo ($i); ?></a>
												</td>
												<td><a href="#"  onclick="_es_openDilog90('<?php echo U('Order/OrderGoodsDetails',array('order_id'=>$vo['order_id']));?>','订单详情','dingdanxiangqing')"><?php echo ($vo["order_sn"]); ?></a></td>
												<td><?php echo ($vo["source_order_sn"]); ?></td>
												<td><?php echo ($vo["order_money"]); ?></td>
												<td><?php echo ($vo["consignee"]); ?></td>
												<td><?php echo ($vo["mobile"]); ?></td>
												<td class="hidden-480"><?php echo ($vo["new_address"]); ?></td>
												<td class="hidden-480"><?php echo (date("Y-m-d H:i:s",$vo["create_time"])); ?></td>
						                        <td>
                                                    <?php if($vo["idcard_syskey"] == '' or $vo["idcard"] == ''): ?>未收集
                                                    <?php else: ?>
                                                         已收集<?php endif; ?>
                                                </td>
												<td><?php echo ($array[$vo['status']]); ?></td>
												
                                                 <td >

                                                 <!-- <button type="button" class="btn btn-sm btn-info"  onclick="cancel_order()"> 查看发货单</button> -->
                                                 
                                                 <?php if($vo["status"] == 4 ): ?><button type="button"class="btn btn-sm btn-success"  onclick="_es_openDilog90('<?php echo U('Order/upload_idcard',array('order_id'=>$vo['order_id']));?>','上传身份证','shangchuanshenfenzheng')"> 上传身份证</button>
                                                 <?php else: ?>
                                                      <?php if($vo["idcard_syskey"] == '' or $vo["idcard"] == ''): ?><button type="button" class="btn btn-sm btn-success"  onclick="_es_openDilog90('<?php echo U('Order/upload_idcard',array('source_order_sn'=>$vo['source_order_sn']));?>','上传身份证','shangchuanshenfenzheng')"> 上传身份证</button>
                                                     <?php else: ?>
                                                    <?php if($vo["pack_status"] != 1 ): ?><button type="button"  class="btn btn-sm btn-success"  onclick="sub_bean(this)"  url="<?php echo U('Order/sub_bean',array('order_id'=>$vo['order_id'],'nav_id'=>$navid));?>"> 提交到51M</button><?php endif; endif; endif; ?>
                                                


                                                 <button style="width:93px;" type="button"class="btn btn-sm btn-success" onclick="_es_openDilog90('<?php echo U('Order/OrderGoodsDetails',array('order_id'=>$vo['order_id']));?>','订单详情','dingdanxiangqing')">  详　　情 </button>
                                                 </td>
                                               
											</tr><?php endforeach; endif; else: echo "" ;endif; ?>
									</tbody>
								</table>
					<!-- 	 <button type="button"  class="btn btn-sm btn-info"  onclick="sub_bean_all()"  url="<?php echo U('Order/sub_bean',array('order_id'=>$vo['order_id'],'nav_id'=>$navid));?>"> 批量提交到Bean</button>	 -->
					<table style="width: 80%; float: right; margin-bottom:10px">
					    <tr>
					        <td style="text-align: right;"> <div class="page_list_ops dataTables_paginate paging_bootstrap pagination" ><?php echo ($lists['page_html']); ?></div></td>
					    </tr>
					</table>
                    
<script type="text/javascript">


    $(function(){
        $("#tbmain tr").hover(function(){
            $(this).css({"background-color":"rgba(243, 236, 236, 0.72)"});
        },function(){
            $(this).css({"background-color":"#fff"});
        });

         $("#alldel").bind("click",checkSel);
    });

     function checkSel(){
       var flg= $(this).is(":checked");
       $("input[type='checkbox']").prop("checked",flg);
    }

   function selallval(){
     var _list="";
     $("#sample-table-2 input[type='checkbox']:checked").each(function(){
         // var flg=$(this).is(":checked");
         //if(!flg)return false;
         var _val=$(this).val();
         if(_val!=""){
         _list+= (_list==""?"":",")+_val;
         } 
     });
     return _list;
} 

//批量提交到bean
function sub_bean_all(){
     //获取需要删除信息
     var _val=selallval();
     
     if(_val==""){
        art.dialog({title:'温馨提示',content: '<span style="color:red;">请勾选需要操作的记录!</span>', ok: function () {this.close();return false;},okval:'确定'});
        return false;
     }
    _show_public_loading();
     $.ajax({
             'url': "<?php echo U('Order/sub_bean_all');?>",
             'data': {'order_ids':_val},
             'dataType': 'json',
             'type': 'POST',
             success: function (data) {
                 if (data.state =="1") {  
                    art.dialog({title:'温馨提示',content: data.msg, ok: function () {this.close();  load();return false;},okval:'确定'});
                 }
             }, error: function (err) { 
                 art.dialog({title:'温馨提示',content: err.responseText, ok: function () {this.close();return false;},okval:'确定'});
             },complete: function () {
                 _hide_public_loading();
             }
         });

}


    function _es_openDilog90(url, title,id){ 
     art.dialog.open(url, { title: title, width: '1000px', height: '80%', opacity: 0.2, id: id, fixed: true,lock: true, close:function(){load();}  });
}


    function sub_bean(_this){
      var url = $(_this).attr('url');
       _show_public_loading();
                 $.ajax({
                    'url':url,
                    'dataType':'json',
                    'type':'post',
                    success:function(data){
                         _hide_public_loading();
                        var retstatus = data.state == 1 ? "1" : "0";
                        showvfmsg(retstatus, data.msg, 3000);
                        load();
                        return false;

                    },error:function(){
                        showvfmsg('error','请求服务器失败',3000);
                    },complete:function(){
                        _hide_public_loading();
                    }
                });
    }

</script>